﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SpatialHashing
{
    class Program
    {
        private class test : IElement
        {
            Vector3 v;
            public test(Vector3 c)
            {
                v = c;
            }
            public Vector3 getPosition()
            {
                return v;
            }
        };

        static void Main(string[] args)
        {
            SpatialHash<test> sh = new SpatialHash<test>(10.0f);
            
            //remember   the idea of the hash is that you don't have a grid
            //you can add cells anywhere

            //add element to hash
            Vector3 v = new Vector3(10.0f, 9.0f, 8.0f);
            test a = new test(v);
            sh.add(a);

            //give me cell size
            Console.WriteLine(sh.getCellSize());

            //test
            Vector3 position = new Vector3(-100.0f, -100.0f, -100.0f);
            float n;
            test b;
            sh.findNearestElement(position, 1.0f, 200.0f, out n, out b);

            //sh.getCellKeysAtCellDistance(new Vector3(3.0f, 3.0f, 3.0f), 1);

            //given a specific cell by key give me middle point
            //given a specific cell by key give me start and end point
            //get all elements in a cell given a cell key
            //given a position, generate the cell key
            //DONT NEED THIS given a position, tell me if there exists a cell that covers that position

            
           //given a position, find the nearestElement whose distance is between a min and a max away
            //create help function that loops over all cells a certain radius away
            //radius means #cells away -> so radius 1 means all cells immediately surround center cell
        }
    }
}
